﻿namespace UnityEditor
{
    using System;
    using System.Runtime.CompilerServices;
    using UnityEngine;

    [Serializable]
    public sealed class TextureImporterSettings
    {
        [SerializeField]
        private int m_Aniso;
        [SerializeField]
        private int m_BorderMipMap;
        [SerializeField]
        private int m_CompressionQuality;
        [SerializeField]
        private int m_ConvertToNormalMap;
        [SerializeField]
        private int m_EnableMipMap;
        [SerializeField]
        private int m_FadeOut;
        [SerializeField]
        private int m_FilterMode;
        [SerializeField]
        private int m_GenerateCubemap;
        [SerializeField]
        private int m_GenerateMipsInLinearSpace;
        [SerializeField]
        private int m_GrayScaleToAlpha;
        [SerializeField]
        private float m_HeightScale;
        [SerializeField]
        private int m_IsReadable;
        [SerializeField]
        private int m_Lightmap;
        [SerializeField]
        private int m_LinearTexture;
        [SerializeField]
        private int m_MaxTextureSize;
        [SerializeField]
        private float m_MipBias;
        [SerializeField]
        private int m_MipMapFadeDistanceEnd;
        [SerializeField]
        private int m_MipMapFadeDistanceStart;
        [SerializeField]
        private int m_MipMapMode;
        [SerializeField]
        private int m_NormalMap;
        [SerializeField]
        private int m_NormalMapFilter;
        [SerializeField]
        private int m_NPOTScale;
        [SerializeField]
        private int m_RecommendedTextureFormat;
        [SerializeField]
        private int m_SeamlessCubemap;
        [SerializeField]
        private int m_TextureFormat;
        [SerializeField]
        private int m_WrapMode;

        public void ApplyTextureType(TextureImporterType type, bool applyAll)
        {
            Internal_ApplyTextureType(this, type, applyAll);
        }

        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public extern void CopyTo(TextureImporterSettings target);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool Equal(TextureImporterSettings a, TextureImporterSettings b);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        private static extern void Internal_ApplyTextureType(TextureImporterSettings s, TextureImporterType type, bool applyAll);

        public int aniso
        {
            get
            {
                return this.m_Aniso;
            }
            set
            {
                this.m_Aniso = value;
            }
        }

        public bool borderMipmap
        {
            get
            {
                return (this.m_BorderMipMap != 0);
            }
            set
            {
                this.m_BorderMipMap = !value ? 0 : 1;
            }
        }

        public int compressionQuality
        {
            get
            {
                return this.m_CompressionQuality;
            }
            set
            {
                this.m_CompressionQuality = value;
            }
        }

        public bool convertToNormalMap
        {
            get
            {
                return (this.m_ConvertToNormalMap != 0);
            }
            set
            {
                this.m_ConvertToNormalMap = !value ? 0 : 1;
            }
        }

        public bool fadeOut
        {
            get
            {
                return (this.m_FadeOut != 0);
            }
            set
            {
                this.m_FadeOut = !value ? 0 : 1;
            }
        }

        public UnityEngine.FilterMode filterMode
        {
            get
            {
                return (UnityEngine.FilterMode) this.m_FilterMode;
            }
            set
            {
                this.m_FilterMode = (int) value;
            }
        }

        public TextureImporterGenerateCubemap generateCubemap
        {
            get
            {
                return (TextureImporterGenerateCubemap) this.m_GenerateCubemap;
            }
            set
            {
                this.m_GenerateCubemap = (int) value;
            }
        }

        public bool generateMipsInLinearSpace
        {
            get
            {
                return (this.m_GenerateMipsInLinearSpace != 0);
            }
            set
            {
                this.m_GenerateMipsInLinearSpace = !value ? 0 : 1;
            }
        }

        public bool grayscaleToAlpha
        {
            get
            {
                return (this.m_GrayScaleToAlpha != 0);
            }
            set
            {
                this.m_GrayScaleToAlpha = !value ? 0 : 1;
            }
        }

        public float heightmapScale
        {
            get
            {
                return this.m_HeightScale;
            }
            set
            {
                this.m_HeightScale = value;
            }
        }

        public bool lightmap
        {
            get
            {
                return (this.m_Lightmap != 0);
            }
            set
            {
                this.m_Lightmap = !value ? 0 : 1;
            }
        }

        public bool linearTexture
        {
            get
            {
                return (this.m_LinearTexture != 0);
            }
            set
            {
                this.m_LinearTexture = !value ? 0 : 1;
            }
        }

        public int maxTextureSize
        {
            get
            {
                return this.m_MaxTextureSize;
            }
            set
            {
                this.m_MaxTextureSize = value;
            }
        }

        public float mipmapBias
        {
            get
            {
                return this.m_MipBias;
            }
            set
            {
                this.m_MipBias = value;
            }
        }

        public bool mipmapEnabled
        {
            get
            {
                return (this.m_EnableMipMap != 0);
            }
            set
            {
                this.m_EnableMipMap = !value ? 0 : 1;
            }
        }

        public int mipmapFadeDistanceEnd
        {
            get
            {
                return this.m_MipMapFadeDistanceEnd;
            }
            set
            {
                this.m_MipMapFadeDistanceEnd = value;
            }
        }

        public int mipmapFadeDistanceStart
        {
            get
            {
                return this.m_MipMapFadeDistanceStart;
            }
            set
            {
                this.m_MipMapFadeDistanceStart = value;
            }
        }

        public TextureImporterMipFilter mipmapFilter
        {
            get
            {
                return (TextureImporterMipFilter) this.m_MipMapMode;
            }
            set
            {
                this.m_MipMapMode = (int) value;
            }
        }

        public bool normalMap
        {
            get
            {
                return (this.m_NormalMap != 0);
            }
            set
            {
                this.m_NormalMap = !value ? 0 : 1;
            }
        }

        public TextureImporterNormalFilter normalMapFilter
        {
            get
            {
                return (TextureImporterNormalFilter) this.m_NormalMapFilter;
            }
            set
            {
                this.m_NormalMapFilter = (int) value;
            }
        }

        public TextureImporterNPOTScale npotScale
        {
            get
            {
                return (TextureImporterNPOTScale) this.m_NPOTScale;
            }
            set
            {
                this.m_NPOTScale = (int) value;
            }
        }

        public bool readable
        {
            get
            {
                return (this.m_IsReadable != 0);
            }
            set
            {
                this.m_IsReadable = !value ? 0 : 1;
            }
        }

        public bool seamlessCubemap
        {
            get
            {
                return (this.m_SeamlessCubemap != 0);
            }
            set
            {
                this.m_SeamlessCubemap = !value ? 0 : 1;
            }
        }

        public TextureImporterFormat textureFormat
        {
            get
            {
                return (TextureImporterFormat) this.m_TextureFormat;
            }
            set
            {
                this.m_TextureFormat = (int) value;
            }
        }

        public TextureWrapMode wrapMode
        {
            get
            {
                return (TextureWrapMode) this.m_WrapMode;
            }
            set
            {
                this.m_WrapMode = (int) value;
            }
        }
    }
}

